﻿using GiveAQuiz.Common;
using System.ComponentModel;
using System.Diagnostics;

namespace GiveAQuiz.Common.Mvvm
{
  public class ViewModelBase : ObservableObject
  {

    string _errorMessage;
    bool _isBusy = false;

    public string ErrorMessage
    {
      get
      {
        return _errorMessage;
      }
      protected set
      {
        if (_errorMessage != value)
        {
          _errorMessage = value;
          RaisePropertyChanged("ErrorMessage");
        }
      }
    }

    public bool IsBusy
    {
      get { return _isBusy; }
      set
      {
        if (value != _isBusy)
        {
          _isBusy = value;
          RaisePropertyChanged("IsBusy");
          Debug.WriteLine(string.Concat("IsBusy changed to:", value));
        }
      }
    }

  }
}
